Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add end to end tests with cypress #115

Closed
wants to merge 8 commits into from
Closed

Add end to end tests with cypress #115

wants to merge 8 commits into from

Conversation

JamesPHoughton
Copy link
Contributor

@JamesPHoughton JamesPHoughton commented Jun 16, 2022

@npaton @amaatouq - I've modified some of the tests we're using in https://github.com/Watts-Lab/deliberation-empirica to run with the empirica template experiment. I'm happy to continue adding to these as we develop more features.

Right now I have a separate GH action running so that I could test in my fork, but in the long run, it might make more sense to include the tests as part of your normal workflow to push to firebase.

Another thing i'd like to add to these tests is to push the empirica_base stage from tests/Dockerfile to dockerhub when the e2e tests pass. Then in our project, I can build our images on a base image from dockerhub instead of installing empirica as part of the Dockerfile build. If you can add me to the dockerhub organization (https://hub.docker.com/u/jamesphoughton) I'm happy to set that up.

@JamesPHoughton
Copy link
Contributor Author

JamesPHoughton commented Jun 16, 2022

Also, it would be helpful to create a cypress dashboard account and record test runs there - right now I have that part of the code commented out. It requires us to:

  • add a CYPRESS_RECORD_KEY secret from the cypress dashboard to .github/workflows/e2e.yaml
  • set record: true in the cypress action parameters
  • modify line 2 of test/cypress.config.js to include the project id from the cypress dashboard projectId: '<id goes here>',

@JamesPHoughton
Copy link
Contributor Author

You'll notice that two of the tests fail. I believe these are associated with the phantom batches we were working on here: #112 (comment)

@npaton
Copy link
Contributor

npaton commented Jun 17, 2022

Wow, very cool! I created the Cypress org and invited you. Having e2e tests is really something we want, but I hadn't put any thought into how it would happen yet. It is an amazing initiative, thank you so much. While I would normally take time to plan, reflect, ponder, and ultimately waste time, I think I will be merging this very soon, and just see how it goes. We can evolve this over time, it looks like a great start! 🙌

@JamesPHoughton
Copy link
Contributor Author

Sweet! I'll slack you the CYPRESS_RECORD_KEY, then we should be rolling. =)

@JamesPHoughton
Copy link
Contributor Author

@npaton I think we still need to give approval for this action to run in the PR - for some reason, it won't run when I update the PR. (https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)

@npaton
Copy link
Contributor

npaton commented Nov 27, 2022

Hey James. We're working on a new set of tests inspired by your work here. I apologize for not having merged this. We must have these tests. But since this PR was pushed, the core libraries have changed dramatically. Knowing that the API might change back then, I figured it was better to wait. We have also decided to go with Playwright instead of Cypress, as it better fits our needs. In the end, it made sense to restart this work from scratch.

You can follow along with the plan for our first tests here: #185
And the PR with the very first new e2e tests: https://github.com/empiricaly/empirica/pull/186/files

We're thankful for any feedback you might have about our plans. 🙏

@npaton npaton closed this Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants